package com.coincalf.feign;

import com.coincalf.dto.MatchDTO;
import com.coincalf.dto.TxDTO;
import com.coincalf.feign.hystrix.MatchServiceClientFallback;
import com.coincalf.framework.http.Response;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @Description:
 * @Author: Chen Long
 * @Date: Created in 2018/5/20 下午5:28
 * @Modified by: Chen Long
 */
@FeignClient(value = "coincalf-service", fallback = MatchServiceClientFallback.class)
public interface MatchServiceClient {

    /**
     * 币币交易撮合完成后更新缓存
     * @param matchDTO
     */
    @RequestMapping(value = "/match/trade", method = RequestMethod.POST)
    Response tradeMatch(@RequestBody MatchDTO matchDTO);

    /**
     * 创新交易撮合完成后更新缓存
     * @param matchDTO
     */
    @RequestMapping(value = "/match/forex", method = RequestMethod.POST)
    Response forexMatch(@RequestBody MatchDTO matchDTO);

    /**
     * 创新交易撮合完成后更新缓存
     * @param txDTO
     */
    @RequestMapping(value = "/match", method = RequestMethod.POST)
    Response match(@RequestBody TxDTO txDTO);
}
